package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.higgins.eventtracking.client.dto.FinanceGoalDTO;
import com.higgins.eventtracking.client.dto.MealDTO;

@PersistenceCapable
public class Meal {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String meal;
	
	@Persistent
	private String type;

	@Persistent
	private Double calories;
	
	@Persistent
	private Double protein;
	
	@Persistent
	private Double fat;
	
	@Persistent
	private Double water;
	
	public Meal()	{
	}
	public Meal(MealDTO dto)	{
		this.meal = dto.getMeal();
		this.type = dto.getType();
		this.calories = dto.getCalories();
		this.protein = dto.getProtein();
		this.fat = dto.getFat();
		this.water = dto.getWater();
	}
	public Meal(String meal, String type, Double calories, Double protein, Double fat, Double water)	{
		this.meal = meal;
		this.type = type;
		this.calories = calories;
		this.protein = protein;
		this.fat = fat;
		this.water = water;
	}
	public void setMeal(String meal)	{
		this.meal = meal;
	}
	public String getMeal()	{
		return meal;
	}
	public void setType(String type)	{
		this.type = type;
	}
	public String getType()	{
		return type;
	}
	public void setCalories(Double calories)	{
		this.calories = calories;
	}
	public Double getCalories()	{
		return calories;
	}
	public void setProtein(Double protein)	{
		this.protein = protein;
	}
	public Double getProtein()	{
		return protein;
	}	
	public void setFat(Double fat)	{
		this.fat = fat;
	}
	public Double getFat()	{
		return fat;
	}
	public void setWater(Double water)	{
		this.water = water;
	}
	public Double getWater()	{
		return water;
	}	
	public MealDTO toDTO()	{
		MealDTO dto = new MealDTO(meal, type, calories, protein, fat, water);
		return dto;
	}
}
